/*相当于百分比了，所以代码就可设计的东西以用*/
function resetFont() {
    var HTML = document.getElementsByTagName('html')[0];
    var ww = document.documentElement.clientWidth;
    if(ww > 750){
     ww = 750;document.documentElement.style.fontSize = ww / 7.5 + 'px';
             }
    var scale = ww / 750; //640是设计图psd的宽度
    HTML.style.fontSize = 100 * scale + 'px';
}
resetFont();
window.onresize = function() {
    resetFont();
}
let dpr = window.devicePixelRatio;  //求出像素比
let scale = 1/dpr;   //求出缩放比例
let width = document.documentElement.clientWidth/6.4 * dpr;  //乘以像素比，rem可以正常使用
let metaN = document.querySelector('meta[name="viewport"]');
//  metaN.setAttribute('content','content','initial-scale=' + scale + ', maximum-scale=' + scale + ', 
//minimum-scale=' + scale + ', user-scalable=no');  //设置缩放

let styleN = document.createElement('style');
styleN.innerHTML = 'html{ font-size:' +  width + 'px; }';  //设置rem
document.head.appendChild(styleN);